''' Mission 7 - Personal Billboard Medium Remix 2A This project moved the code to display the item to each button press so that the screen is cleared and instructions shown after each item. The list can include text, images or colors. There is no scrolling during this program - each button assigns a value to choice. ''' from codex import * from time import sleep choice = 0 my_list = ["School colors: Blue & Gold", BLUE, YELLOW, pics.TARGET, pics.TIARA, "School mascot: Bears"] # MAIN PROGRAM while True: # clear screen and show instructions display.fill(BLACK) display.show("Press a button") sleep(1) # each button press assigns a value to choice and # displays the item if buttons.was_pressed(BTN_L): choice = 1 my_image = my_list[choice] if type(my_image) == tuple: display.fill(my_image) else: display.show(my_image) if buttons.was_pressed(BTN_R): choice = 2 my_image = my_list[choice] if type(my_image) == tuple: display.fill(my_image) else: display.show(my_image) if buttons.was_pressed(BTN_D): choice = 3 my_image = my_list[choice] if type(my_image) == tuple: display.fill(my_image) else: display.show(my_image) if buttons.was_pressed(BTN_U): choice = 0 my_image = my_list[choice] if type(my_image) == tuple: display.fill(my_image) else: display.show(my_image) if buttons.was_pressed(BTN_A): choice = 4 my_image = my_list[choice] if type(my_image) == tuple: display.fill(my_image) else: display.show(my_image) if buttons.was_pressed(BTN_B): choice = 5 my_image = my_list[choice] if type(my_image) == tuple: display.fill(my_image) else: display.show(my_image) # display item for 2 seconds sleep(2)